package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
	"strings"
)

func main() {
	read := bufio.NewReaderSize(os.Stdin, 1000)
	lineTemp, err := strconv.ParseInt(reader(read), 10, 64)
	checkError(err)
	m := make(map[string]uint64)
	for i := 0; i < int(lineTemp); i++ {
		name := ""
		var num uint64
		fmt.Scanf("%s %d",&name,&num)
		m[name] = num
	}
	for i := 0; i < int(lineTemp); i++ {
		read = bufio.NewReaderSize(os.Stdin, 1000)
		line1 := reader(read)
		checkError(err)
		if val, ok := m[line1]; ok {
			fmt.Printf("%s=%d\n", line1,val)
		}else{
			fmt.Println("Not found")
		}
	}
}
func checkError(err error) {
	if err != nil {
		fmt.Println("read error:", err)
	}
}
func reader(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}
	return strings.TrimRight(string(str), "\r\n")
}
